﻿using System.Collections.Generic;
using System.Xml.Serialization;

public class GameModelXml {
	// === Public =====================================================================================================
	[XmlArray("Elements"), XmlArrayItem("Element")]
	public List<Element> ElementsToXml { get; private set; }

	public GameModelXml() {
		Init();
	}

	public GameModelXml(GameModel gameModel) {
		Init();
		ConvertElementsToXml(gameModel);
	}

	public void Init() {
		ElementsToXml = new List<Element>();
	}

	public void ConvertElementsToXml(GameModel gameModel) {
		ElementsToXml.Clear();
		foreach (var element in gameModel.Elements) {
			ElementsToXml.Add(element.ElementModel);
		}
	}
}
